var listDocuments = null;
$(function(){
	var curPath = $('#currentPath').val();
	var trStatus = "false";
	var uEmail = $('#emailOwner').val();
	setInterval(function() {
		$.getJSON("/manage/realTimeUpdateData", {"currentPath": curPath, "trashStatus": trStatus, "userEmailOwner": uEmail, "listDocumentOld": JSON.stringify(listDocuments)}, function(data){
			console.log(listDocuments);
			if (data.info === "Success"){
				
			}
			else{
				var dataSet = data.data;
				var dataTable = $('#dataTableManagement').dataTable();
				dataTable.fnClearTable();
				for(i=dataSet.length-1; i >= 0;i--){
				    dataTable.fnAddData(dataSet[i]);
				}
				callShareHover();
				listDocuments = data.info;
			}
		});
	}, 3000);
});